import router, { ROOT_ROUTE_NAME, buildSubAppViewRoutes } from '@core/utils/router';
import type { RouteModule } from '@core/utils/router';

const viewRouteModules = import.meta.glob<RouteModule>(
  '../views/*/routes.*',
  { eager: true },
);

router.addRoute({
  path: '/',
  name: ROOT_ROUTE_NAME,
  redirect: '/overview/index',
  children: buildSubAppViewRoutes(viewRouteModules),
});

export default router;
